package isjinhao.jlox.grammar.expression.represention;

import isjinhao.jlox.grammar.expression.visitor.ExpressionVisitor;
import isjinhao.jlox.lexical.Token;
import lombok.Getter;

/**
 * @Author ISJINHAO
 * @Date 2021/2/20 21:33
 */
@Getter
public class Comparison extends Expression {

    public Comparison(Expression left, Token operator, Expression right) {
        this.left = left;
        this.operator = operator;
        this.right = right;
    }

    private final Expression left;
    private final Token operator;
    private final Expression right;

    @Override
    public <R> R accept(ExpressionVisitor<R> expressionVisitor) {
        return expressionVisitor.visitComparisonExpr(this);
    }
}